package com.group.yztcedu.playlive.main.home.loadmore;

import com.group.yztcedu.playlive.bean.LoadMoreBean;
import com.group.yztcedu.playlive.utils.HttpUtils;

import java.util.HashMap;

public class LoadMorePresenter implements LoadMoreContract.Presenter {
    private LoadMoreContract.View view;
    private LoadMoreContract.Model model;
    public LoadMorePresenter(LoadMoreContract.View view,LoadMoreContract.Model model){
        this.view = view;
        this.model = model;
    }
    @Override
    public void initData(HashMap<String, String> params) {
        model.getLoadMoreData(params, new HttpUtils.HttpCallBack<LoadMoreBean>() {
            @Override
            public void onSuccess(LoadMoreBean loadMoreBean) {
                view.onSuccessGetLoadMore(loadMoreBean.getData());
            }

            @Override
            public void onFail() {
            view.onFailGetLoadMore("网络连接错误");
            }
        });
    }
}
